package com.cb.web.wasf.sample.web;

import com.cb.web.wasf.State;
import com.cb.web.wasf.Request;
import com.cb.web.wasf.View;
import com.cb.web.wasf.View.JspView;

/**
 * @author CBO
 */
public class CartState extends AbstractMenuSupportState {

    private long pineappleCount = 0;
    private long tomatoCount = 0;

    public CartState() {
        super();
    }

    public long getPineappleCount() {
        return pineappleCount;
    }

    public long getTomatoCount() {
        return tomatoCount;
    }

    public State oneMorePineapple(Request request) {
        pineappleCount++;
        return this;
    }

    public State oneMoreTomato(Request request) {
        tomatoCount++;
        return this;
    }

    @Override
    public View getView() {
        return new JspView(this, "/WEB-INF/jsp/cart.jsp");
    }
}
